---
sidebar_position: 7
---

# Tokens

Access tokens using Chronik.

:::note
This page only lists token-specific endpoints.
All other APIs (tx, history, utxos, etc.) also contain token data where applicable.
:::

## `token(tokenId)`

Return token info for the given tokenId

See [token](../api/classes/ChronikClient#token) API docs.

```jsx live
function DemoToken() {
    return (
        <Json
            fn={async () => {
                // CRD token
                return await chronik.token(
                    'cdcdcdcdcdc9dda4c92bb1145aa84945c024346ea66fd4b699e344e45df2e145',
                );
            }}
        />
    );
}
```

## `tokenId(tokenId)`

Return an object that can be used to fetch token data from Chronik in a fluent interface.

See [tokenId](../api/classes/ChronikClient#tokenid) API docs.

```jsx live
function DemoTokenId() {
    return (
        <Json
            fn={async () => {
                // CRD Genesis is first
                return await chronik
                    .tokenId(
                        'cdcdcdcdcdc9dda4c92bb1145aa84945c024346ea66fd4b699e344e45df2e145',
                    )
                    .confirmedTxs(0, 1);
            }}
        />
    );
}
```

## `history(pageOffset, pageSize)`

Fetch the tx history of a Token ID, from latest to earliest.

See [history](../api/classes/TokenIdEndpoint#history) API docs.

```jsx live
function DemoTokenIdHistory() {
    return (
        <Json
            fn={async () => {
                // The latest CRD tx
                return await chronik
                    .tokenId(
                        'cdcdcdcdcdc9dda4c92bb1145aa84945c024346ea66fd4b699e344e45df2e145',
                    )
                    .history(0, 1);
            }}
        />
    );
}
```

## `confirmedTxs(pageOffset, pageSize)`

Fetch the confirmed txs of a Token ID, from first to last.

See [confirmedTxs](../api/classes/TokenIdEndpoint#confirmedtxs) API docs.

```jsx live
function DemoTokenIdConfirmedTxs() {
    return (
        <Json
            fn={async () => {
                // CRD GENESIS
                return await chronik
                    .tokenId(
                        'cdcdcdcdcdc9dda4c92bb1145aa84945c024346ea66fd4b699e344e45df2e145',
                    )
                    .confirmedTxs(0, 1);
            }}
        />
    );
}
```

## `unconfirmedTxs()`

Fetch the unconfirmed txs of a Token ID.

See [unconfirmedTxs](../api/classes/TokenIdEndpoint#unconfirmedtxs) API docs.

```jsx live
function DemoTokenIdUnconfirmedTxs() {
    return (
        <Json
            fn={async () => {
                // Grumpy token txs in mempool
                return await chronik
                    .tokenId(
                        'fb4233e8a568993976ed38a81c2671587c5ad09552dedefa78760deed6ff87aa',
                    )
                    .unconfirmedTxs();
            }}
        />
    );
}
```

## `utxos()`

Fetch the utxos of a Token ID.

See [utxos](../api/classes/TokenIdEndpoint#utxos) API docs.

```jsx live
function DemoTokenIdUtxos() {
    return (
        <Json
            fn={async () => {
                // Some CRD UTXO
                return (
                    await chronik
                        .tokenId(
                            'cdcdcdcdcdc9dda4c92bb1145aa84945c024346ea66fd4b699e344e45df2e145',
                        )
                        .utxos()
                ).utxos[0];
            }}
        />
    );
}
```
